import { Bmobs } from "../plugins/bmob";

export class CourseDao extends  Bmobs {
	constructor() {
		super()
	}
	
	public async getCourseList () {
	
	}
	
	public async getClassListDao(): Promise<Array<Object>> {
		this.setTableName("couresClass");
		this.query.order("classId");
		return await this.QueryAll();
	}
	
	public async getCourseListDao(id: string): Promise<Array<Object>> {
		this.setTableName("coures");
		this.query.equalTo("courseClassId", "==", id);
		return await this.QueryAll();
	}
	
	public async getIndexCourse(): Promise<Array<Object>> {
		this.setTableName("coures");
		this.query.limit(3);
		this.query.order("-createdAt");
		return await this.QueryAll();
	}
}